#ifndef AST_DECLARATIONS_INITIALIZER_H
#define AST_DECLARATIONS_INITIALIZER_H

#include "../ASTNode.h"
class AssignmentExpr;
class InitializerList;

/*
C99   6.7.8
initializer:
		assignment-expression
		{   initializer-list   }
		{   initializer-list   ,   }
*/
class Initializer : public ASTNode
{
public:
	enum{
		assignment_expr,
		initializer_list,
	};
protected:
	Initializer(void)
		: ASTNode(ASTNode::initializer){};
public:
	Initializer(AssignmentExpr *pAssignExpr)
		: ASTNode(ASTNode::initializer)
		, m_iType(assignment_expr)
		, m_pAssignExpr(pAssignExpr){};

	Initializer(InitializerList *pInitList)
		: ASTNode(ASTNode::initializer)
		, m_iType(initializer_list)
		, m_pInitList(pInitList){};

	virtual ~Initializer(void);

	virtual void					codeGen();

protected:
	tiny_int						m_iType;
	union{
		AssignmentExpr *			m_pAssignExpr;
		InitializerList *			m_pInitList;
	};
};


#endif


